/**
 * @Author     :lanbery
 * @e-mail     : lanbery@gmail.com
 * @version    : V1.0
 * @createtime : 2011-11-13-下午12:08:27
 */
package com.lambor.common.util;

import java.io.Serializable;

/**
 * @about this class :
 * @author           ： lanbery
 * @e-mail           : lanbery@gmail.com
 * @version          : V1.0
 * @modifytime       : 2011-11-13-下午12:08:27
 * @filepath         : SSI-com.lambor.common.util//UUIDGenerator.java
 *
 */
public class UUIDGenerator implements Serializable {
	/**
	 * @notation: 
	 * @field: serialVersionUID-long
	 *
	 */
	private static final long serialVersionUID = -422525447707784806L;

	/**
	 * 
	 * @method annotations: 获取36位UUID字符串
	 * @creator           : lanbery
	 * @createtime        : 2011-11-13-下午12:25:18 
	 * @return            : String
	 * UUIDGenerator.method()
	 *
	 */
	public static String getUUID(){
		String uuid = org.doomdark.uuid.UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
		return uuid;
	}
	
	/**
	 * 
	 * @method annotations: 获取32位UUID字符串
	 * @creator           : lanbery
	 * @createtime        : 2011-11-13-下午12:26:06 
	 * @return            : String
	 * UUIDGenerator.method()
	 *
	 */
	public static String getUUID32(){
		String uuid = org.doomdark.uuid.UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
		return uuid.replaceAll("-", "");
	}
	
	/**
	 * 
	 * @method annotations: 获取32位大写UUID字符串
	 * @creator           : lanbery
	 * @createtime        : 2011-11-13-下午12:26:41 
	 * @return            : String
	 * UUIDGenerator.method()
	 *
	 */
	public static String getUUID32upperCase(){
		String uuid = org.doomdark.uuid.UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
		return uuid.replaceAll("-", "").toUpperCase();
	}
	
	public static void main(String args[]){
		System.out.println("36>>>"+UUIDGenerator.getUUID());
		System.out.println("32>>>"+UUIDGenerator.getUUID32());
		System.out.println("32upper>>>"+UUIDGenerator.getUUID32upperCase());
		for(int i=0;i<20;i++){
			System.out.println("the["+i+"]32upper>>>"+UUIDGenerator.getUUID32upperCase());
		}
	}
	
}
